package com.example.usbhidtool

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.example.usbhidtool.hid.bean.CmdEventStatus
import com.example.usbhidtool.hid.bean.CmdLinkStatus

class HidPageViewModel : ViewModel() {

    //设备状态
    val deviceStatus = MutableLiveData<String>()

    //设备版本
    val deviceVersion = MutableLiveData<String>()

    //安卓版本
    val appAVersion = MutableLiveData<String>()

    //IOS版本
    val appIVersion = MutableLiveData<String>()

    //客户手机插入状态
    val eventStatus = MutableLiveData<CmdEventStatus>()

    //连接状态
    val connectStatus = MutableLiveData<CmdLinkStatus>()

    fun reset() {
        deviceStatus.value = ""
        deviceVersion.value = ""
        appAVersion.value = ""
        appIVersion.value = ""
        eventStatus.value = CmdEventStatus.UNKNOWN
        connectStatus.value = CmdLinkStatus.UNKNOWN
    }


    init {
        deviceStatus.value = ""
        deviceVersion.value = ""
        appAVersion.value = ""
        appIVersion.value = ""
        eventStatus.value = CmdEventStatus.UNKNOWN
        connectStatus.value = CmdLinkStatus.UNKNOWN
    }
}